package com.example.module_service.viewmodel

import com.example.lib_common.view.entity.AddPointEntity
import com.example.lib_common.view.entity.CarAddEntity
import com.example.lib_common.view.entity.CarAddParam
import com.example.lib_common.view.entity.CarPayEntity
import com.example.lib_common.view.entity.CarPayParam
import com.example.lib_common.view.entity.CarStopEntityItem
import com.example.lib_common.view.entity.BaseResponse
import com.example.lib_common.view.entity.CarplateEntity
import com.example.lib_common.view.entity.DeviceDetailEntity
import com.example.lib_common.view.entity.DeviceEntity
import com.example.lib_common.view.entity.PatrolEntity
import com.example.lib_common.view.entity.PatrolTaskBeanItem
import com.example.module_service.api.ServerApiServer
import com.example.module_service.park.ParkBeanItem
import javax.inject.Inject

class ServerRepository @Inject constructor(private val apiServer: ServerApiServer) {
    suspend fun getPark(areaId:Int):BaseResponse<List<ParkBeanItem>>{
        return apiServer.getPark(areaId)
    }
    suspend fun getDevice(): BaseResponse<List<DeviceEntity>> {
        return apiServer.getDeviceList()
    }

    suspend fun getDeviceDetail(id:Int):BaseResponse<DeviceDetailEntity>{
        return apiServer.getDeviceDetail(id)
    }
    //getProvince
    suspend fun getProvince():BaseResponse<List<CarplateEntity>>{
        return apiServer.getProvince()
    }

    suspend fun getAddCar(carAddParam: CarAddParam): BaseResponse<CarAddEntity> {
        return apiServer.getAddCar(carAddParam)
    }
    //getAddCarPay

    suspend fun getAddCarPay(carPayParam: CarPayParam): BaseResponse<CarPayEntity> {
        return apiServer.getAddCarPay(carPayParam)
    }

    //getCarStop
    suspend fun getCarStop():BaseResponse<List<CarStopEntityItem>>{
        return apiServer.getCarStop()
    }
    suspend fun getPatrol():BaseResponse<List<PatrolEntity>>{
        return apiServer.getPatrol()
    }

    suspend fun addPoint(addPointEntity: AddPointEntity):BaseResponse<AddPointEntity>{
        return apiServer.addPoint(addPointEntity)
    }

    //getPatrolTaskByStatus
    suspend fun getPatrolTaskByStatus(status:String):BaseResponse<List<PatrolTaskBeanItem>>{
        return apiServer.getPatrolTaskByStatus(status)
    }
    //getPatrolTaskByStatus
    suspend fun getTaskById(id:Int):BaseResponse<PatrolTaskBeanItem>{
        return apiServer.getTaskById(id)
    }
//    suspend fun getAddCarPay():BaseResponse<CarPayEntity>{
//        return apiServer.getAddCarPay()
//    }
}